package cn.com.nes.mybatis.agent.ope.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

/**
 * <p>
 * 设备协议查询指令返回数据项表
 * </p>
 *
 * @author nes
 * @since 2023-02-28
 */
@TableName("is_device_protocol_data_item_info")
public class IsDeviceProtocolDataItemInfo extends Model<IsDeviceProtocolDataItemInfo> {

    private static final long serialVersionUID = 1L;

    /**
     * 设备协议查询指令返回数据项id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 数据项id
     */
    @TableField("data_item_id")
    private String dataItemId;
    /**
     * 厂商id
     */
    @TableField("manufacture_id")
    private String manufactureId;
    /**
     * 协议id
     */
    @TableField("protocol_id")
    private String protocolId;
    /**
     * 设备协议查询指令id
     */
    @TableField("query_command_id")
    private String queryCommandId;
    /**
     * 数据项标题(用来存储别名)
     */
    @TableField("name")
    private String name;
    /**
     * 单位值
     * d_type_28
     */
    @TableField("unit_value")
    private String unitValue;
    /**
     * 参数分类
     */
    private String classify;
    /**
     * 起始字节
     */
    @TableField("start_byte")
    private Integer startByte;
    /**
     * 字节长度
     */
    @TableField("byte_length")
    private Integer byteLength;
    /**
     * 数据项转换方式id
     * d_type_11
     */
    @TableField("convert_id")
    private Integer convertId;
    /**
     * 数据转换方式计算公式
     */
    private String formula;
    /**
     * 是否故障检测(0:不检测;1:检测)
     * d_type_67
     */
    @TableField("is_check_fault")
    private Integer isCheckFault;
    /**
     * 正常值
     */
    @TableField("normal_value")
    private String normalValue;
    /**
     * 故障码
     */
    @TableField("fault_code")
    private String faultCode;
    /**
     * 字段类型：空或line
     */
    @TableField("chartType")
    private String chartType;
    /**
     * 数据项值类型:1:累计指标数据; 2:即时状态数据
     * d_type_30
     */
    @TableField("value_type")
    private Integer valueType;
    /**
     * 数据类型:0:有符号的;1:无符号的
     * d_type_68
     */
    @TableField("data_type")
    private Integer dataType;
    /**
     * 数据来源
     */
    private String sjly;
    /**
     * 字节存储次序;0:小头序;1:大头序
     * d_type_69
     */
    private Integer endian;
    /**
     * 异常值
     */
    @TableField(value = "error_value")
    private String errorValue;
    /**
     * 异常值的替换值
     */
    @TableField("error_replace_value")
    private String errorReplaceValue;
    /**
     * 二进制时的bit位
     */

    @TableField(value = "bit_place")
    private Integer bitPlace;

    @TableField(value= "bit_place_end")
    private Integer bitPlaceEnd;
    /**
     * 数据项模板id
     */
    @TableField(value = "template_id")
    private String templateId;
    /**
     * 前端显示名称
     */
    @TableField("fore_name")
    private String foreName;
    /**
     * 排序序号
     */
    @TableField("item_sort_number")
    private String itemSortNumber;
    /**
     * plc设备id(可对应多个)
     */
    @TableField("plc_sb_id")
    private String plcSbId;
    /**
     * 合理值范围下限
     */
    @TableField("reasonable_range_low")
    private BigDecimal reasonableRangeLow;
    /**
     * 合理值范围上限
     */
    @TableField("reasonable_range_up")
    private BigDecimal reasonableRangeUp;
    /**
     * 字段类型：0-字符，1-数值，2-时间
     * d_type_70
     */
    @TableField("field_type")
    private Integer fieldType;
    /**
     * mqtt协议数据项地址
     */
    @TableField("mqtt_address")
    private String mqttAddress;
    /**
     * mqtt协议是否可读写0-否，1-是
     * d_type_71
     */
    @TableField("is_read_write")
    private Integer isReadWrite;
    /**
     * 逻辑删除  1 表示删除，0 表示未删除
     */
    @TableField("is_deleted")
    private Integer isDeleted;
    /**
     * 创建人
     */
    @TableField("cr_oper")
    private String crOper;
    /**
     * 创建时间
     */
    @TableField("gmt_create")
    private Date gmtCreate;
    /**
     * 修改人
     */
    @TableField("up_oper")
    private String upOper;
    /**
     * 修改时间
     */
    @TableField("gmt_modified")
    private Date gmtModified;
    /**
     * 数据版本号  当前时间戳
     */
    private Long version;

    /**
     * 寄存器地址
     */
    @TableField("register_address")
    private Integer registerAddress;

    /**
     * 寄存器类型（DO-线圈寄存器，DI-离散输入寄存器，AR-输入寄存器，HR-保持寄存器）
     */
    @TableField("register_type")
    private String registerType;

    @TableField("data_type_enum")
    private String dataTypeEnum;

    @TableField("command_cut")
    private Integer commandCut;

    @TableField(value= "show_range_up")
    private BigDecimal showRangeUp;

    @TableField(value= "show_range_low")
    private BigDecimal showRangeLow;



    public BigDecimal getShowRangeUp() {
        return showRangeUp;
    }

    public void setShowRangeUp(BigDecimal showRangeUp) {
        this.showRangeUp = showRangeUp;
    }

    public BigDecimal getShowRangeLow() {
        return showRangeLow;
    }

    public void setShowRangeLow(BigDecimal showRangeLow) {
        this.showRangeLow = showRangeLow;
    }

    public Integer getCommandCut() {
        return commandCut;
    }

    public void setCommandCut(Integer commandCut) {
        this.commandCut = commandCut;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDataItemId() {
        return dataItemId;
    }

    public void setDataItemId(String dataItemId) {
        this.dataItemId = dataItemId;
    }

    public String getManufactureId() {
        return manufactureId;
    }

    public void setManufactureId(String manufactureId) {
        this.manufactureId = manufactureId;
    }

    public String getProtocolId() {
        return protocolId;
    }

    public void setProtocolId(String protocolId) {
        this.protocolId = protocolId;
    }

    public String getQueryCommandId() {
        return queryCommandId;
    }

    public void setQueryCommandId(String queryCommandId) {
        this.queryCommandId = queryCommandId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUnitValue() {
        return unitValue;
    }

    public void setUnitValue(String unitValue) {
        this.unitValue = unitValue;
    }

    public String getClassify() {
        return classify;
    }

    public void setClassify(String classify) {
        this.classify = classify;
    }

    public Integer getStartByte() {
        return startByte;
    }

    public void setStartByte(Integer startByte) {
        this.startByte = startByte;
    }

    public Integer getByteLength() {
        return byteLength;
    }

    public void setByteLength(Integer byteLength) {
        this.byteLength = byteLength;
    }

    public Integer getConvertId() {
        return convertId;
    }

    public void setConvertId(Integer convertId) {
        this.convertId = convertId;
    }

    public String getFormula() {
        return formula;
    }

    public void setFormula(String formula) {
        this.formula = formula;
    }

    public Integer getIsCheckFault() {
        return isCheckFault;
    }

    public void setIsCheckFault(Integer isCheckFault) {
        this.isCheckFault = isCheckFault;
    }

    public String getNormalValue() {
        return normalValue;
    }

    public void setNormalValue(String normalValue) {
        this.normalValue = normalValue;
    }

    public String getFaultCode() {
        return faultCode;
    }

    public void setFaultCode(String faultCode) {
        this.faultCode = faultCode;
    }

    public String getChartType() {
        return chartType;
    }

    public void setChartType(String chartType) {
        this.chartType = chartType;
    }

    public Integer getValueType() {
        return valueType;
    }

    public void setValueType(Integer valueType) {
        this.valueType = valueType;
    }

    public Integer getDataType() {
        return dataType;
    }

    public void setDataType(Integer dataType) {
        this.dataType = dataType;
    }

    public String getSjly() {
        return sjly;
    }

    public void setSjly(String sjly) {
        this.sjly = sjly;
    }

    public Integer getEndian() {
        return endian;
    }

    public void setEndian(Integer endian) {
        this.endian = endian;
    }

    public String getErrorValue() {
        return errorValue;
    }

    public void setErrorValue(String errorValue) {
        this.errorValue = errorValue;
    }

    public String getErrorReplaceValue() {
        return errorReplaceValue;
    }

    public void setErrorReplaceValue(String errorReplaceValue) {
        this.errorReplaceValue = errorReplaceValue;
    }



    public String getTemplateId() {
        return templateId;
    }

    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }

    public String getForeName() {
        return foreName;
    }

    public void setForeName(String foreName) {
        this.foreName = foreName;
    }

    public String getItemSortNumber() {
        return itemSortNumber;
    }

    public void setItemSortNumber(String itemSortNumber) {
        this.itemSortNumber = itemSortNumber;
    }

    public String getPlcSbId() {
        return plcSbId;
    }

    public void setPlcSbId(String plcSbId) {
        this.plcSbId = plcSbId;
    }

    public BigDecimal getReasonableRangeLow() {
        return reasonableRangeLow;
    }

    public void setReasonableRangeLow(BigDecimal reasonableRangeLow) {
        this.reasonableRangeLow = reasonableRangeLow;
    }

    public BigDecimal getReasonableRangeUp() {
        return reasonableRangeUp;
    }

    public void setReasonableRangeUp(BigDecimal reasonableRangeUp) {
        this.reasonableRangeUp = reasonableRangeUp;
    }

    public Integer getFieldType() {
        return fieldType;
    }

    public void setFieldType(Integer fieldType) {
        this.fieldType = fieldType;
    }

    public String getMqttAddress() {
        return mqttAddress;
    }

    public void setMqttAddress(String mqttAddress) {
        this.mqttAddress = mqttAddress;
    }

    public Integer getIsReadWrite() {
        return isReadWrite;
    }

    public void setIsReadWrite(Integer isReadWrite) {
        this.isReadWrite = isReadWrite;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public String getCrOper() {
        return crOper;
    }

    public void setCrOper(String crOper) {
        this.crOper = crOper;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public String getUpOper() {
        return upOper;
    }

    public void setUpOper(String upOper) {
        this.upOper = upOper;
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    public static final String ID = "id";

    public static final String DATA_ITEM_ID = "data_item_id";

    public static final String MANUFACTURE_ID = "manufacture_id";

    public static final String PROTOCOL_ID = "protocol_id";

    public static final String QUERY_COMMAND_ID = "query_command_id";

    public static final String NAME = "name";

    public static final String UNIT_VALUE = "unit_value";

    public static final String CLASSIFY = "classify";

    public static final String START_BYTE = "start_byte";

    public static final String BYTE_LENGTH = "byte_length";

    public static final String CONVERT_ID = "convert_id";

    public static final String FORMULA = "formula";

    public static final String IS_CHECK_FAULT = "is_check_fault";

    public static final String NORMAL_VALUE = "normal_value";

    public static final String FAULT_CODE = "fault_code";

    public static final String CHARTTYPE = "chartType";

    public static final String VALUE_TYPE = "value_type";

    public static final String DATA_TYPE = "data_type";

    public static final String SJLY = "sjly";

    public static final String ENDIAN = "endian";

    public static final String ERROR_VALUE = "error_value";

    public static final String ERROR_REPLACE_VALUE = "error_replace_value";

    public static final String BIT_PLACE = "bit_place";

    public static final String BIT_PLACE_END = "bit_place_end";

    public static final String TEMPLATE_ID = "template_id";

    public static final String FORE_NAME = "fore_name";

    public static final String ITEM_SORT_NUMBER = "item_sort_number";

    public static final String PLC_SB_ID = "plc_sb_id";

    public static final String REASONABLE_RANGE_LOW = "reasonable_range_low";

    public static final String REASONABLE_RANGE_UP = "reasonable_range_up";

    public static final String FIELD_TYPE = "field_type";

    public static final String MQTT_ADDRESS = "mqtt_address";

    public static final String IS_READ_WRITE = "is_read_write";

    public static final String IS_DELETED = "is_deleted";

    public static final String CR_OPER = "cr_oper";

    public static final String GMT_CREATE = "gmt_create";

    public static final String UP_OPER = "up_oper";

    public static final String GMT_MODIFIED = "gmt_modified";

    public static final String VERSION = "version";

    public static final String REGISTER_ADDRESS = "register_address";

    public static final String REGISTER_TYPE = "register_type";

    public static final String DATA_TYPE_ENUM = "data_type_enum";

    @Override
    public Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "IsDeviceProtocolDataItemInfo{" +
                ", id=" + id +
                ", dataItemId=" + dataItemId +
                ", manufactureId=" + manufactureId +
                ", protocolId=" + protocolId +
                ", queryCommandId=" + queryCommandId +
                ", name=" + name +
                ", unitValue=" + unitValue +
                ", classify=" + classify +
                ", startByte=" + startByte +
                ", byteLength=" + byteLength +
                ", convertId=" + convertId +
                ", formula=" + formula +
                ", isCheckFault=" + isCheckFault +
                ", normalValue=" + normalValue +
                ", faultCode=" + faultCode +
                ", chartType=" + chartType +
                ", valueType=" + valueType +
                ", dataType=" + dataType +
                ", sjly=" + sjly +
                ", endian=" + endian +
                ", errorValue=" + errorValue +
                ", errorReplaceValue=" + errorReplaceValue +
                ", bitPlace=" + bitPlace +
                ", bitPlaceEnd=" + bitPlaceEnd +
                ", templateId=" + templateId +
                ", foreName=" + foreName +
                ", itemSortNumber=" + itemSortNumber +
                ", plcSbId=" + plcSbId +
                ", reasonableRangeLow=" + reasonableRangeLow +
                ", reasonableRangeUp=" + reasonableRangeUp +
                ", fieldType=" + fieldType +
                ", mqttAddress=" + mqttAddress +
                ", isReadWrite=" + isReadWrite +
                ", isDeleted=" + isDeleted +
                ", crOper=" + crOper +
                ", gmtCreate=" + gmtCreate +
                ", upOper=" + upOper +
                ", gmtModified=" + gmtModified +
                ", version=" + version +
                "}";
    }

    public Integer getRegisterAddress() {
        return registerAddress;
    }

    public void setRegisterAddress(Integer registerAddress) {
        this.registerAddress = registerAddress;
    }

    public String getRegisterType() {
        return registerType;
    }

    public void setRegisterType(String registerType) {
        this.registerType = registerType;
    }

    public String getDataTypeEnum() {
        return dataTypeEnum;
    }

    public void setDataTypeEnum(String dataTypeEnum) {
        this.dataTypeEnum = dataTypeEnum;
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(this.dataItemId);
    }

    public Integer getBitPlace() {
        return bitPlace;
    }

    public void setBitPlace(Integer bitPlace) {
        this.bitPlace = bitPlace;
    }

    public Integer getBitPlaceEnd() {
        return bitPlaceEnd;
    }

    public void setBitPlaceEnd(Integer bitPlaceEnd) {
        this.bitPlaceEnd = bitPlaceEnd;
    }
}
